Skip to content

Upper case the SQL queries.#330

Merged
jaeadams merged 1 commit into
mainfrom
adamscj.capitalization
Feb 4, 2026
Merged

Upper case the SQL queries.#330
jaeadams merged 1 commit into
mainfrom
adamscj.capitalization

Conversation

@jaeadams
Copy link
Copy Markdown
Contributor

@jaeadams jaeadams commented Feb 4, 2026

This upper cases the SQL queries, for a more standard format.

@jaeadams jaeadams requested a review from a team as a code owner February 4, 2026 19:31
@jaeadams jaeadams self-assigned this Feb 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 4, 2026

🤖 Claude Code Review

Let me proceed with the code review based on the diff analysis and available context.


PR Code Review - sz_snapshot SQL Formatting Changes

Summary

This PR converts SQL queries in sz_snapshot from lowercase to uppercase, standardizing SQL keyword formatting. The changes are purely cosmetic—no functional logic has been modified.


✅ Code Quality

Style Guide Compliance

✅ PASS - The changes improve code consistency by using uppercase SQL keywords, which is a common SQL formatting convention. While I couldn't fetch the Senzing code-style.md guide (permission required), uppercase SQL keywords are generally considered best practice for readability and are consistent with ANSI SQL conventions.

No Commented-Out Code

✅ PASS - No commented-out code found in the diff. The existing comment on line 196 is legitimate documentation explaining why an alternative approach isn't used.

Meaningful Variable Names

✅ PASS - Not applicable to this PR. No variable names were changed; only SQL formatting was modified.

DRY Principle

✅ PASS - Not applicable. No code duplication introduced or removed.

Defects & Edge Cases

✅ PASS - No logic changes means no new bugs introduced. The SQL queries remain functionally identical:

  • Lines 168-178: sql_entities query - uppercase conversion only
  • Lines 181-194: sql_relations query - uppercase conversion only
  • Lines 198-204: sql_features query - uppercase conversion only
  • Lines 573-579: max_sql query for filtered data source - uppercase conversion only
  • Lines 582-587: entity_sql query - uppercase conversion only

Note: Line 582 has "SELECT DISTINCT" without a space before A.RES_ENT_ID on the next line, but this is just string concatenation formatting and doesn't affect the SQL.


⚠️ Testing

Unit Tests for New Functions

N/A - No new functions added. This is a formatting-only change.

Integration Tests for New Endpoints

N/A - No new endpoints added.

Edge Cases Covered

N/A - No new edge cases introduced.

Test Coverage > 80%

❌ UNKNOWN - Cannot verify current test coverage without running the test suite. However, since this is a non-functional change (formatting only), existing tests should continue to pass if they existed before.

Recommendation: Run make test and make coverage to verify:

make test
make coverage

⚠️ Documentation

README Updated

✅ PASS - No README updates needed for SQL formatting changes.

API Docs Updated

✅ PASS - No API changes; documentation update not required.

Inline Comments for Complex Logic

✅ PASS - Existing inline comment preserved at line 196: # below not currently used in favor of sdk as does a better job identifying unique features

CHANGELOG.md Updated

❌ FAIL - CHANGELOG.md was not updated. While this is a minor cosmetic change, Senzing projects typically document all changes for traceability.

Recommendation: Add an entry to CHANGELOG.md:

### Changed
- Standardized SQL queries to uppercase keywords in sz_snapshot for improved readability

Markdown Formatting (CommonMark)

N/A - No markdown files modified in this PR.


✅ Security

No Hardcoded Credentials

✅ PASS - No credentials found in the diff.

Input Validation

✅ PASS - No changes to input validation logic.

Proper Error Handling

✅ PASS - No changes to error handling.

No Sensitive Data in Logs

✅ PASS - No logging changes.

License Files Check

✅ PASS - No .lic files or AQAAAD strings detected in the diff.


📋 Project Memory (.claude/CLAUDE.md) Compliance

✅ PASS - The .claude/CLAUDE.md file contains general project information about architecture, commands, and code style. It doesn't contain any local-environment-specific configuration. The content is appropriate for all developers.

The PR aligns with the documented code style:

  • Line length remains well under 120 characters ✅
  • Python 3.10+ compatibility maintained ✅
  • No impact on the codebase architecture ✅

🔍 Additional Observations

Positive Aspects

  1. Consistency: Uppercase SQL keywords improve readability and follow ANSI SQL conventions
  2. Non-breaking: Zero functional changes reduce risk
  3. Complete coverage: All SQL queries in the file were updated consistently

Minor Issues

  1. Line 582 formatting: Consider adding a space for visual clarity:
# Current:
entity_sql = (
    "SELECT DISTINCT"
    " A.RES_ENT_ID "

# Suggested:
entity_sql = (
    "SELECT DISTINCT "  # Added space after DISTINCT
    " A.RES_ENT_ID "
  1. Line 573 formatting: Extra space in "SELECT " (two spaces):
max_sql = (
    "SELECT  "  # <-- Extra space here
    " MIN(B.RES_ENT_ID), "

This should probably be "SELECT " with one space.


Summary & Recommendations

Category Status Critical Issues
Code Quality ✅ PASS 0
Testing ⚠️ UNKNOWN 0
Documentation ❌ FAIL 1 (CHANGELOG)
Security ✅ PASS 0
Project Config ✅ PASS 0

Required Actions

  1. Update CHANGELOG.md - Document this formatting change
  2. Run test suite - Verify make test and make coverage pass
  3. Consider fixing line 573:572 extra space in "SELECT "

Optional Improvements

  • Line 582: Add space after "SELECT DISTINCT" for consistency

Overall Assessment: This is a low-risk, beneficial change that improves code readability. The only blocking issue is the missing CHANGELOG entry.

Automated code review analyzing defects and coding standards

@jaeadams jaeadams merged commit e43d910 into main Feb 4, 2026
61 checks passed
@jaeadams jaeadams deleted the adamscj.capitalization branch February 4, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants